﻿using TI_BLE_HCI_ClientLib.GenericHCIEntities;
using TI_BLE_HCI_ClientLib.HCIBaseEntities;

namespace TI_BLE_HCI_ClientLib.HCIEvents
{
    public class HCIEvent_GAP_Command_Status : HCIVendorSpecificEvent
    {
        private HCIVendorSpecificEventHostErrorCode _status;
        private HCIVendorSpecificCommandOpcode _opCode;
        private byte[] _commandPayload;

        public HCIVendorSpecificEventHostErrorCode Status
        {
            get { return _status; }
            set { _status = value; }
        }

        public HCIVendorSpecificCommandOpcode Opcode
        {
            get { return _opCode; }
            set { _opCode = value; }
        }

        public byte DataLen
        {
            get { return (byte)_commandPayload.Length; }
        }

        public byte[] CommandPayload
        {
            get { return _commandPayload; }
            set { _commandPayload = value; }
        }

        public HCIEvent_GAP_Command_Status(
            HCIVendorSpecificEventHostErrorCode status,
            HCIVendorSpecificCommandOpcode opCode,
            byte[] commandPayload)
            : base((ushort)HCIVendorSpecificEventEventOpcode.GAP_HCI_Extension_CommandStatus)
        {
            _status = status;
            _opCode = opCode;
            _commandPayload = commandPayload;
        }
    }
}